package com.hankol.feature_wine_meal.adapter

import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.baselibrary.utils.GlideUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.feature_wine_meal.R
import com.hankol.feature_wine_meal.bean.MainFood

/**
 * @author: 关忆北、
 * @date: 2022/6/13
 * @Des：下酒菜详情步骤
 */
class WineDetailsStepAdapter(var viewHeight: Int) : BaseQuickAdapter<MainFood, BaseViewHolder>(R.layout.item_wine_details_step) {
    override fun convert(helper: BaseViewHolder, item: MainFood) {
        val ivStep = helper.getView<ImageView>(R.id.iv_step)
        val params: RelativeLayout.LayoutParams = ivStep.layoutParams as RelativeLayout.LayoutParams
        params.height = viewHeight
        ivStep.layoutParams = params
        GlideUtils.loadImg_228(mContext.applicationContext, item.cover, ivStep)
        helper.setText(R.id.tv_step_info, item.desc)
                .setText(R.id.tv_step, "步骤${item.sort}")

        helper.addOnClickListener(R.id.iv_step)
    }
}